package com.wheel.autoconfigure.web.mvc.swagger;/*
 * <h3>Title:ai-chiefcomplaint系统</h3>
 * <p>Copyright (c) 2021, wnfbx. All rights reserved.</p>
 * @author wnfbx
 */

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import springfox.documentation.service.ApiInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * <dt>Description:SwaggerAutoConfigureProperties</dt>
 * <dd>自动配置属性</dd>
 *
 * @author wnfbx
 * @version 1.0 <i>2021/8/6 14:22</i>
 * @since jdk1.7+
 */
@ConfigurationProperties(prefix = "w.swagger")
public class SwaggerAutoConfigureProperties {

    private List<HeaderProperties> headerProperties= new ArrayList<>();

    public List<HeaderProperties> getHeaderProperties() {
        return headerProperties;
    }

    public void setHeaderProperties(List<HeaderProperties> headerProperties) {
        this.headerProperties = headerProperties;
    }
    @NestedConfigurationProperty
    private String basePackage;

    public String getBasePackage() {
        return basePackage;
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }

    @NestedConfigurationProperty
    private ApiInfo apiInfo;

    public ApiInfo getApiInfo() {
        return apiInfo;
    }

    public void setApiInfo(ApiInfo apiInfo) {
        this.apiInfo = apiInfo;
    }

    static class HeaderProperties {

        private String name;
        private String description;
        private String modelRef;
        private boolean required = true;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getModelRef() {
            return modelRef;
        }

        public void setModelRef(String modelRef) {
            this.modelRef = modelRef;
        }

        public boolean isRequired() {
            return required;
        }

        public void setRequired(boolean required) {
            this.required = required;
        }
    }
}
